﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ChuangDu_Spirit_QGB_IDAL;
namespace ChuangDu_Spirit_QGB_BLL
{
    public abstract partial class BaseBLL<T> where T : class, new()
    {
        public BaseBLL()
        {
            SetDal();
        }
        public IBaseDAL<T> Dal { get; set; }
        public abstract void SetDal();
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public int Add(T t)
        {
            return Dal.Add(t);
        }
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public int Delete(T t)
        {

            return Dal.Delete(t);
           
        }
        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public int Update(T t)
        {
            return Dal.Update(t);
        }
        /// <summary>
        /// 显示全部数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable<T> show()
        {
            return Dal.show();
        }
    }
}
